﻿<%@ Page Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true" CodeFile="EditProfile.aspx.cs"
    Inherits="Secured_EditProfile" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolder1" runat="Server">
    <div style="font-size: large">
        Edit Profile of&nbsp;<%= Page.User.Identity.Name.ToString() %>
    </div>
    <br />
    <div>
        <asp:Literal ID="ltMsg" runat="server" />
    </div>
    <br />
    <div>
        <fieldset style="padding: 10px">
            <legend>
                <%= Page.User.Identity.Name.ToString().ToUpper() %></legend>
            <br />
            <span style="float: left; width: 50%">
                <asp:FormView ID="fvEditProfile" runat="server" EnableModelValidation="True" Width="350px">
                    <ItemTemplate>
                        <table style="padding: 20px; width: 350px;">
                            <tr>
                                <td>
                                    <strong>User ID:</strong>
                                </td>
                                <td>
                                    <%# Eval("UserID") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>User Name:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtUserName" runat="server" Text='<%# Eval("UserName") %>' 
                                        ReadOnly="True" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>First Name:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Last Name:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtLastName" runat="server" Text='<%# Eval("LastName") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Display Name:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDisplayName" runat="server" Text='<%# Eval("DisplayName") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Date of Birth:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDOB" runat="server" Text='<%# Eval("DOB","{0:dd/MMM/yyyy}") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Email Address:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEmail" runat="server" Text='<%# Eval("EMailAddr") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Secret Question:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtSecQuestion" runat="server" Text='<%# Eval("SecretQuestion") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Secret Answer:</strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAnswer" runat="server" Text='<%# Eval("SecretAnswer") %>' />
                                </td>
                        </table>
                        <hr />
                        <div style="float: right">
                            <asp:Button ID="btnBack" runat="server" Text="Back" CommandName="Back" OnCommand="btnBack_Command" />&nbsp;<asp:Button
                                ID="btnSaveChanges" runat="server" Text="Save Changes" 
                                CommandName="SaveChanges" oncommand="btnSaveChanges_Command" />
                        </div>
                        <br />
                    </ItemTemplate>
                </asp:FormView>
            </span>&nbsp; <span style="float: right; width: 50%">
                <asp:FormView ID="fvAccountInfo" runat="server" EnableModelValidation="True">
                    <ItemTemplate>
                        <table style="padding: 10px; width: 350px">
                            <tr>
                                <td>
                                    <strong>Approved:</strong>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem,"IsApproved") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Last Login Date:</strong>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem,"LastLogin") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Last Password Changed Date:</strong>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem,"ForcePasswordChangedDate") %>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:FormView>
            </span>
            <br />
        </fieldset>
    </div>
</asp:Content>
